package com.zszedu.web.controller;

import com.zszedu.pojo.Income;
import com.zszedu.service.IncomeService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("income")
public class IncomeController {
    @DubboReference
    private IncomeService incomeService;

    @GetMapping("earnings")
    public List<Income> earnings(@RequestHeader("uid") Long uid){
        return incomeService.queryByUid(uid);
    }
}
